package com.lekang.service.impl;

import java.util.List;
import com.lekang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lekang.mapper.PendingTasksMapper;
import com.lekang.domain.PendingTasks;
import com.lekang.service.IPendingTasksService;

/**
 * 待办任务Service业务层处理
 * 
 * @author wjy
 * @date 2025-10-23
 */
@Service
public class PendingTasksServiceImpl implements IPendingTasksService 
{
    @Autowired
    private PendingTasksMapper pendingTasksMapper;

    /**
     * 查询待办任务
     * 
     * @param id 待办任务主键
     * @return 待办任务
     */
    @Override
    public PendingTasks selectPendingTasksById(Long id)
    {
        return pendingTasksMapper.selectPendingTasksById(id);
    }

    /**
     * 查询待办任务列表
     * 
     * @param pendingTasks 待办任务
     * @return 待办任务
     */
    @Override
    public List<PendingTasks> selectPendingTasksList(PendingTasks pendingTasks)
    {
        return pendingTasksMapper.selectPendingTasksList(pendingTasks);
    }

    /**
     * 新增待办任务
     * 
     * @param pendingTasks 待办任务
     * @return 结果
     */
    @Override
    public int insertPendingTasks(PendingTasks pendingTasks)
    {
        pendingTasks.setCreateTime(DateUtils.getNowDate());
        return pendingTasksMapper.insertPendingTasks(pendingTasks);
    }

    /**
     * 修改待办任务
     * 
     * @param pendingTasks 待办任务
     * @return 结果
     */
    @Override
    public int updatePendingTasks(PendingTasks pendingTasks)
    {
        pendingTasks.setUpdateTime(DateUtils.getNowDate());
        return pendingTasksMapper.updatePendingTasks(pendingTasks);
    }

    /**
     * 批量删除待办任务
     * 
     * @param ids 需要删除的待办任务主键
     * @return 结果
     */
    @Override
    public int deletePendingTasksByIds(Long[] ids)
    {
        return pendingTasksMapper.deletePendingTasksByIds(ids);
    }

    /**
     * 删除待办任务信息
     * 
     * @param id 待办任务主键
     * @return 结果
     */
    @Override
    public int deletePendingTasksById(Long id)
    {
        return pendingTasksMapper.deletePendingTasksById(id);
    }
}
